<template>
  <div v-loading="orderInfoLoading" class="orderInfoDetail">
    <ContentWrap>
      <List :column="4" sep="：" label-width="100">
        <ListItem label="电商单号" :value="orderDetail.code" />
        <ListItem label="平台单号" :value="orderDetail.pcode" />
        <ListItem label="平台名称" :value="orderDetail.platformName" />
        <ListItem label="店铺名称" :value="orderDetail.storeName" />
        <ListItem label="顾客ID" :value="orderDetail.buyer" />
        <ListItem label="顾客姓名" :value="orderDetail.orderReceiverName" />
        <ListItem label="联系方式1" :value="orderDetail.orderReceiverPhone" />
        <ListItem label="联系方式2" :value="orderDetail.orderReceiverPhone" />
        <ListItem label="所属省" :value="orderDetail.orderReceiverProvinceName" />
        <ListItem label="所属市" :value="orderDetail.orderReceiverCityName" />
        <ListItem label="所属区" :value="orderDetail.orderReceiverDistrictName" />
        <ListItem label="所属街(道)" :value="orderDetail.orderReceiverTownName" />
        <ListItem label="顾客收货地址" :value="orderDetail.orderReceiverAddress" :span="24" />
        <ListItem label="物流方式" :value="orderDetail.logisticsMode" />
        <ListItem label="快递公司编码" :value="orderDetail.logisticsCode" />
        <ListItem label="快递公司名称" :value="orderDetail.logisticsName" />
        <ListItem label="快递单号" :value="orderDetail.waybillNo" />
        <ListItem label="快递其他信息" :value="orderDetail.logisticsInfo" />
        <ListItem label="配送方式" :value="orderDetail.serviceMode" />
        <ListItem label="办事处编码" :value="orderDetail.belongOfficeCode" />
        <ListItem label="办事处" :value="orderDetail.belongOfficeName" />
        <ListItem label="服务商编码" :value="orderDetail.serviceProviderCode" />
        <ListItem label="服务商名称" :value="orderDetail.serviceProviderName" />
        <ListItem label="业务账号编码" :value="orderDetail.accountCode" />
        <ListItem label="业务账号名称" :value="orderDetail.accountName" :span="12" />
        <ListItem label="下单时间" :value="orderDetail.bookTime" />
        <ListItem label="付款时间" :value="orderDetail.payTime" />
        <ListItem label="审核时间" :value="orderDetail.auditTime" />
        <ListItem label="发货时间" :value="orderDetail.deliverTime" />
        <ListItem label="要求送货时间" :value="orderDetail.deliveryTime" />
        <ListItem label="支付方式" :value="orderDetail.payMode" />
        <ListItem label="订单状态" :value="orderDetail.billStatus" />
        <ListItem label="平台状态" :value="orderDetail.platformBillStatus" />
        <ListItem label="订单类型" :value="orderDetail.orderType" />
        <ListItem label="订单来源" :value="orderDetail.orderSource" />
        <ListItem label="异常标识" :value="orderDetail.isException === 1 ? '是' : orderDetail.isException === 0 ? '否' : '--'" />
        <ListItem label="异常原因" :span="24" :value="orderDetail.exceptionType" />
        <ListItem label="冻结标识" :value="orderDetail.isLock" />
        <ListItem label="送达方名称" :value="orderDetail.shiptopartyName" :span="12" />
        <ListItem label="活动作废" :value="orderDetail.promStatus" />
        <ListItem label="关联运费" :value="orderDetail.freightOrderFee" />
        <ListItem label="成交金额" :value="orderDetail.totalReceivableFee" />
        <ListItem label="退款申请金额(售中)" :value="orderDetail.saleRefundApplyMny" />
        <ListItem label="应结算金额(售中)" :value="orderDetail.saleSettleShouldMny" />
        <ListItem label="已结算金额(售中)" :value="orderDetail.saleSettleOverMny" />
        <ListItem label="退款申请金额(售后)" :value="orderDetail.afterSaleRefundApplyMny" />
        <ListItem label="已结算金额(售后退款)" :value="orderDetail.afterSaleSettleOverMny" />
        <ListItem label="结算状态" :value="orderDetail.settleStatus" />
        <ListItem label="核算状态" :value="orderDetail.adjustStatus" />
        <ListItem label="(应结-已结)售中差额" :value="orderDetail.saleUnSettleMny" />
        <ListItem label="发货状态" :value="orderDetail.sendStatus ? orderDetail.sendStatus : '--'" />
        <ListItem label="签收状态" :value="orderDetail.signStatus" />
        <ListItem label="订单已排产" :value="orderDetail.storePlanNum" />
        <ListItem label="导购员名称" :value="orderDetail.o2oGuideName" />
        <ListItem label="导购门店名称" :value="orderDetail.o2oShopName" />
      </List>
    </ContentWrap>
  </div>
</template>

<script>
import ContentWrap from '@/components/ContentWrap'
import { List, ListItem } from '@/components/List'
import { parseTime } from '@/utils/index'
export default {
  components: {
    ContentWrap,
    List,
    ListItem
  },
  props: {
    orderDetail: {
      type: Object,
      default: () => ({})
    }
  },
  data() {
    return {
      orderInfoLoading: false,
      data: []
    }
  },
  created() {
    if (this.orderDetail.deliverTime) this.orderDetail.deliverTime = parseTime(this.orderDetail.deliverTime)
    if (this.orderDetail.bookTime) this.orderDetail.bookTime = parseTime(this.orderDetail.bookTime)
    if (this.orderDetail.payTime) this.orderDetail.payTime = parseTime(this.orderDetail.payTime)
    if (this.orderDetail.deliveryTime) this.orderDetail.deliveryTime = parseTime(this.orderDetail.deliveryTime)
  },
  mounted() {},
  methods: {
    // 物流方式
    async formatLogisticsMode(state) {
      const txt = await this.$getDictValue('LOGISTICSMODE', state)
      return txt
    },
    // 配送方式
    async formatServiceMode(state) {
      const txt = await this.$getDictValue('SERVICEMODE', state)
      return txt
    },
    // 订单类型
    async formatOrderType(state) {
      const txt = await this.$getDictValue('ORDERTYPE', state)
      return txt
    },
    // 平台状态
    async formatPlatformStatus(state) {
      const txt = await this.$getDictValue('PLATFORMBILLSTATUS', state)
      return txt
    },
    // 订单来源
    async formatOrderSource(state) {
      const txt = await this.$getDictValue('ORDERSOURCE', state)
      return txt
    },
    async formatIsLock(state) {
      const txt = await this.$getDictValue('ISLOCK', state)
      return txt
    },
    // 核算状态
    async formatAdjustStatus(state) {
      const txt = await this.$getDictValue('ADJUSTSTATUS', state)
      return txt
    },
    // 发货状态
    async formatSendStatus(state) {
      const txt = await this.$getDictValue('SENDSTATUS', state)
      return txt
    }
  }
}
</script>

<style lang="scss" scoped>
.orderInfoDetail {
  .content-wrap {
    overflow-y: auto;
  }
}
.orderInfoDetail .content-wrap {
  padding: 10px 20px;
}
.orderInfoDetail .content-wrap /deep/ .el-row .el-col {
  line-height: 32px;
}
.orderInfoDetail .content-wrap /deep/ .el-row .custom-list-item {
  margin-bottom: 0;
}
.orderInfoDetail .content-wrap /deep/ .el-row .custom-list-item .label-style {
  text-align-last: right;
}
.orderInfoDetail .content-wrap /deep/ .el-row .custom-list-item span:first-child {
  width: auto;
  font-size: 12px;
  text-align: right;
}
.orderInfoDetail .content-wrap /deep/ .el-row .custom-list-item span:last-child {
  font-size: 12px;
}
</style>
